<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ConvertDateComponent
 *
 * @author X-Men
 */
class ConvertDateComponent extends Component
{
    
    function convertdate()
    {
        $date = date("Y-m-d H:i:s"); 
        $day = date('l',  strtotime($date));
        $dateConvert = date("d/m/Y", strtotime($date));
        
        $day_converted = "";
        switch ($day)
        {
            case 'Monday': $day_converted = 'Thứ 2';
                break;
            case 'Tuesday': $day_converted = 'Thứ 3';
                break;
            case 'Wednesday': $day_converted = 'Thứ 4';
                break;
            case 'Thursday': $day_converted = 'Thứ 5';
                break;
            case 'Friday': $day_converted = 'Thứ 6';
                break;
            case 'Saturday': $day_converted = 'Thứ 7';
                break;
            case 'Sunday': $day_converted = 'Chủ Nhật';
                break;
        }
        return $day_converted.', '.$dateConvert;
    }

}
